package com.wust.smartcity.demo.server.core.api.feign.client.impl;

import com.wust.smartcity.common.dto.WebResponseDto;
import com.wust.smartcity.common.entity.sys.importexport.SysImportExport;
import com.wust.smartcity.demo.server.core.api.feign.client.ImportExportService;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;

/**
 * @author ：wust
 * @date ：Created in 2019/9/7 10:26
 * @description：
 * @version:
 */
@Service
public class ImportExportServiceFallbackImpl implements ImportExportService {
    static Logger logger = LogManager.getLogger(ImportExportServiceFallbackImpl.class);
    @Override
    public WebResponseDto insert(String ctx, SysImportExport entity) {
        logger.error("调用admin服务异常，熔断器发生作用{},{}",ctx,entity);
        WebResponseDto responseDto = new WebResponseDto();
        responseDto.setFlag(WebResponseDto.INFO_ERROR);
        responseDto.setMessage("调用admin服务异常");
        return responseDto;
    }

    @Override
    public WebResponseDto selectOne(String ctx, SysImportExport search) {
        logger.error("调用admin服务异常，熔断器发生作用{},{}",ctx,search);
        WebResponseDto responseDto = new WebResponseDto();
        responseDto.setFlag(WebResponseDto.INFO_ERROR);
        responseDto.setMessage("调用admin服务异常");
        return responseDto;
    }

    @Override
    public WebResponseDto updateByPrimaryKeySelective(String ctx, SysImportExport entity) {
        logger.error("调用admin服务异常，熔断器发生作用{},{}",ctx,entity);
        WebResponseDto responseDto = new WebResponseDto();
        responseDto.setFlag(WebResponseDto.INFO_ERROR);
        responseDto.setMessage("调用admin服务异常");
        return responseDto;
    }
}
